package test;

import java.io.BufferedReader;
import java.io.PrintWriter;

public class ClientOutNet  extends Thread {

		 private PrintWriter printWriter;  
		    private BufferedReader bufferedReader;  
		      
		    public    ClientOutNet(PrintWriter pw,BufferedReader in){  
		        this.printWriter = pw;  
		        this.bufferedReader=in;  
		        start();  
		     }  
		      
		      
		    public void run(){  
		        while(true){  
		            try{  
		                String inStr = bufferedReader.readLine();  
		                if(inStr.equals("exit")){  
		                    printWriter.close();  
		                    bufferedReader.close();  
		                    break;  
		                }else{  
		                    printWriter.println(inStr);
		                }  
		                sleep(300);  
		            }catch(Exception e){  
		                printWriter = null;  
		                bufferedReader = null;  
		                throw new RuntimeException(e);  
		            }  
		        }  
		     }  
}
